home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 61
/
061.d81
/
ml relocater
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
6KB
|
177 lines
10 clr:print"[147]":poke53280,0:poke53281,0
20 open1,0:dim nc(60),c2(110),n2(110),ab(40),ae(40)
25 gosub61000:print"[147]"chr$(142)chr$(8)
30 printtab(7)"[176][174] [176][174]"
40 printtab(7)"[173][219][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][219][189]"
50 printtab(7)" [221] [158] ml re-locater [221] "
60 printtab(7)" [221] [221]"
70 printtab(7)" [221][159] by:jeff babuschak [221]"
80 printtab(7)"[176][219][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][219][174]"
90 printtab(7)"[173][189] [173][189]"
100 fora=1to20:print"[209][158][209]";:nexta
110 gosub480
120 print"please enter new starting address:";:input#1,ns$
130 print:print"are you sure? [y/n/q]:";:input#1,s$:print
140 ns=val(ns$):ifns=0then120
145 ifs$="q"then1400
150 ifs$<>"y"ands$<>"n"then120
160 ifs$="n"then120
170 fora=1to20:print"[209][158][209]";:nexta:print
180 print"does this program contain data? [y/n/m]:";
190 input#1,da$
200 ifda$<>"y"andda$<>"n"andda$<>"m"then180
210 print:print"are you sure? [y/n/q]:";:input#1,s$:print
215 ifs$="q"then1400
220 ifs$<>"y"ands$<>"n"then210
230 il=-1
240 ifs$="n"then180
250 ifda$="m"then410
260 ifda$="n"then410
270 il=il+1:print""
280 fort=1to14:print" ";:nextt:print
290 print""
300 fora=1to20:print"[209][158][209]";:nexta:print
310 print"[145]enter beginning address:";:input#1,ab$(il):print
320 print"enter ending address:";:input#1,ae$(il):print
330 ab(il)=val(ab$(il)):ae(il)=val(ae$(il))
340 print"are you sure? [y/n/q]:";:input#1,s$:print:print"[145]";
345 ifs$="q"then1400
350 ifs$="y"andae(il)=0andab(il)=0then401
360 ifab(il)>ae(il)then290
361 ifae(il)<sathen290
362 ifab(il)<sathen290
370 ifs$="y"and(ae(il)-ab(il))<1then290
380 ifs$<>"y"ands$<>"n"then340
390 ifs$="n"then290
400 goto 270
401 print:print"[145][145]"
410 fora=1to20:print"[209][158][209]";:nexta:print:print"[145][145]";
420 fort=0toil:ab(t)=abs(val(ab$(t))-sa):ae(t)=abs(val(ae$(t))-sa):nextt
430 print"enter name of destination file:";:input#1,d$:print
440 print"[145]";:fora=1to20:print"[209][158][209]";:nexta:print
450 close1:open1,8,1,"@0:"+d$+",p,w":hi=int(ns/256):lo=ns-(hi*256)
460 print#1,chr$(lo);:print#1,chr$(hi);
470 mp=11000:mr=12000:goto570
480 rem *** disk routine ***
490 print"enter name of ml file:";:input#1,f$:iff$="q"then1400
500 print:fora=1to20:print"[209][158][209]";:nexta:print
510 open2,8,2,"0:"+f$:open15,8,15:input#15,a$,b$,c$,d$:ifval(a$)>0then1260
520 get#2,lo$:get#2,hi$:lo=asc(lo$+chr$(0)):hi=asc(hi$+chr$(0))
530 sa=hi*256+lo
540 print"[145]starting address is:"sa
550 print:print"[145][145]":fora=1to20:print"[209][158][209]";:nexta:print
560 return
570 rem *** set-up ***
580 il=0:read nc(d)
590 ifnc(d)=999then610
600 d=d+1:goto580
610 read c2(d2),n2(d2)
620 ifc2(d2)=999then640
630 d2=d2+1:goto610
640 ea=0
650 ea=ea+1:get#2,x$:da=asc(x$+chr$(0)):pokeea+mr-1,da:ifst<>0thenclose2
660 ifst=0then650
670 r=ea+1
680 ifda$="n"orda$="y"then810
690 rem *** check for data ***
700 da=peek(mr+l+yy):forc=0tod:ifnc(c)=dathenng=ng+3:yy=yy+2
710 nextc:yy=yy+1:ifyy<5then700
720 yy=0:print"[158]"l
730 da=peek(mr+l+yy):forc=0tod2
740 ifc2(c)=daandn2(c)=2thenng=ng+2:yy=yy+1
750 ifc2(c)=daandn2(c)=1thenng=ng+1
760 nextc:yy=yy+1:ifyy<5then730
770 if(ng/yy)<1thenfort=1toyy:pokemp+l,peek(mr+l):l=l+1:nextt:l=l-1
780 if(ng/yy)<1andl<rthenyy=0:ng=0:ol=l:goto690
790 if(ng/yy)<1andl>=rthen1350
800 ng=0:ol=l:yy=0
810 rem *** relocation routine ***
820 ifl=>ab(il)thendi=(ae(il)-ab(il))
830 ifl=>ab(il)thenfort=0todi:poke(mp+ab(il)+t),peek(mr+ab(il)+t):next
840 ifl=>ab(il)thenil=il+1:l=t+l
850 xy=0:print"[158]";l:da=peek(l+mr):forc=0tod
860 ifnc(c)=dathengosub960
870 nextc:ifxy=3then930
880 xy=0:da=peek(mr+l):forg=0tod2
890 ifc2(g)=daandn2(g)=1thenpokemp+l,da:l=l+1:xy=1
900 ifc2(g)=daandn2(g)=2thenpokemp+l,da:l=l+1:pokemp+l,peek(mr+l):l=l+1:xy=2
910 nextg
920 ifxy=0thenpokemp+l,da:l=l+1
930 ifl>=rthen1350
940 ifda$="m"and(l-ol)>=3then700
950 goto820
960 rem *** process 3 byte comms. ***
970 xy=3:l1=peek(l+mr+1):h1=peek(l+mr+2):n=h1*256+l1
975 ifn<saorn>sa+ea+1thenpokemp+l,da:pokemp+l+2,h1:pokemp+l+1,l1:l=l+3:return
980 ifn>53247orn<2048thenpokemp+l,da:pokemp+l+2,h1:pokemp+l+1,l1:l=l+3:return
990 ifn<49152andn>40959thenpokemp+l,da:pokemp+l+2,h1:pokemp+l+1,l1:l=l+3:return
1000 pokemp+l,da:ifns>=sathennj=(h1*256+l1)+(ns-sa):ifnj>65280thenn=53248:goto980
1010 ifns<sathennj=((h1*256)+l1)-(sa-ns)
1020 pokemp+l+2,int(nj/256)
1030 pokemp+l+1,int(nj-(256*(int(nj/256))))
1040 pokemp+l,da:l=l+3
1050 return
1060 rem *** 3 byte data ***
1070 data 109,125,121,45,61,57,14
1080 data 30,44,205,221,217,235,204
1090 data 206,222,77,93,89,238,254
1100 data 76,108,32,173,189,185,174
1110 data 190,172,188,78,94,13,29,25
1120 data 46,62,110,126,237,235,249
1130 data 141,157,153,142,140,999
1140 rem *** 1&2 byte data ***
1150 data 105,2,101,2,117,2,97,2,113,2,41,2,37,2,53,2,33,2,49,2,10,1,6,2,22,2
1160 data 144,2,176,2,240,2,36,2,48,2,208,2
1170 data 16,2,0,1,80,2,112,2,24,1,216,1,88,1,184,1,201,2,197,2,213,2,193,2
1180 data 209,2,224,2,228,2,192,2,196,2,198,2
1190 data 214,2,202,1,136,1,73,2,69,2,85,2,65,2,81,2,230,2,246,2,232,1,200,1
1200 data 169,2,165,2,181,2,161,2,177,2
1210 data 162,2,166,2,182,2,160,2,164,2,180,2,74,2,70,2,86,2,234,1
1220 data 9,2,5,2,21,2,1,2,17,2,72,1,8,1,104,1,40,1,42,1
1230 data 38,2,54,2,106,1,102,2,118,2,64,1,96,1,233,2,229,2,245,2,225,2
1240 data 241,2,56,1,248,1,120,1,133,2,149,2,129,2
1250 data 145,2,134,2,150,2,132,2,148,2,170,1,168,1,186,1,138,1,154,1,152,1,999,0
1260 rem *** error routine ***
1270 print"io/error[146]:";a$;",";b$;",";c$;",";d$
1280 close1:close2:close15
1290 poke54276,0:s=54272:v=s+24:pokev,4
1300 pokes+5,0:pokes+6,15*16:pokes+4,33
1310 pokes,4:pokes+1,48:fora=0to350:next:pokes,2:pokes+1,24:fora=0to350:next
1320 pokev,0:print:printtab(8)"[158]press any key to restart"
1330 ifpeek(197)<>64thenpoke198,0:run
1340 goto1330
1350 rem *** close disk ***
1360 fora=0toea:print#1,chr$(peek(mp+a));:nexta
1370 print#1,chr$(0);chr$(0);chr$(0);chr$(0):close1:close2:close15
1380 print"[147]"tab(18)"done!":goto1410
1400 close1:close2:close15:print"[147][159]"
1410 printtab(8)"space[159] - run the program again"
1420 printtab(8)" l [159] - return to loadstar"
1430 geta$:ifa$<>" "anda$<>"l"then1430
1440 ifa$=" "thenrun
1450 open15,8,15,"r0:hello connect=hello connect":input#15,er%:close15
1460 ifer%<>63thenend
1470 print"[147][144]load"chr$(34)"hello connect"chr$(34)",8"
1475 print"[144]run"
1480 poke631,13:poke632,13:poke198,2
1500 new
61000 poke214,15:print""
61110 print" [155][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184]"
61120 print" [152] "
61130 print" "
61140 print" "
61150 print" [208]ublished on [204][207][193][196][211][212][193][210] #61 "
61160 print" [211]ubscriptions 1-800-831-2694 "
61170 print" [195][200][193][206][199][201][206][199][160][212][200][201][211][160][206][207][212][201][195][197][160][201][211][160][201][204][204][197][199][193][204] "
61180 print" "
61190 print" [151][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185]"
61200 au$="[205][204] [210]elocater":poke214,17:print:printspc(20-len(au$)/2)"[152]"au$
61210 au$="[194]y [202]eff [194]abuschak ([195]) 1989":poke214,18:print
61220 printspc(20-len(au$)/2)"[152]"au$""
61230 print""
61240 printtab(10)"[159][205] [204] [210] [197] [204] [207] [195] [193] [212] [197] [210]"
61245 print"[154] from [195]ommodore [205]agazine - [202]une 1989"
61247 p